package com.mini.common.vo;

/**
 * @author 小鱼儿
 * @date 2020/11/16 18:30
 */
public class ResData<T> {

    private int code;

    private String msg;

    private T data;


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }


    public static <T> ResData buildResData(T t){
        ResData resData = new ResData();
        resData.setData(t);
        return resData;
    }

    public static ResData buildErrorResData(int code){
        ResData resData = new ResData();
        resData.setCode(code);
        return resData;
    }
}
